The Document Object Model and JavaScript > The document object model in Dreamweaver > Properties and methods of text objects

 

Properties and methods of text objects

Each contiguous block of text in an HTML document (for example, the text within a P tag) is represented by a JavaScript object. Text objects never have children. The following table lists the properties and methods of text objects in Dreamweaver, along with explanations where appropriate. A bullet (·) marks read-only properties.
Property or method Return value and explanation

nodeType ·

Node.TEXT_NODE

parentNode ·

The parent tag.

childNodes ·

An empty NodeList.

data

The actual text string. Entities in the text are represented as a single character (for example, the text Joseph & I is returned as Joseph & I).

hasChildNodes()

false